package com.employ.admin.service;

import com.employ.admin.common.Result;
import com.employ.admin.entity.Book;
import com.employ.admin.mapper.BookMapper;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;

@Component
@Service
public class BookService {

    @Resource
    BookMapper bookMapper;
    public Result<?> insert(@RequestBody Book book){
        bookMapper.insert(book);

        System.out.println("插入书籍成功");
        return Result.success();
    }


    public Result<?> updateById(@RequestBody Book book){
        bookMapper.updateById(book);

        System.out.println("更新书籍成功");
        return Result.success();
    }

}
